import React, { useState } from 'react';
import { Input, Checkbox, Popover, Button, Image, Space, Row, Col, } from 'antd';
import aliOssUpload from '@/utils/aliOssUpload';
import { backgroundObj } from '@/utils/utils'
import './index.less'
const Cephalogram = (props) => {
  const {
    data = {},
    index,
    selectIndex,
    onChange
  } = props
  const {
    label,
    desc,
    imgsrc
  } = data
  const defaultImg = ''
  return (
    <Row style={{ paddingBottom: 24 }} gutter={[24, 24]}>
      <Col span={12} offset={6}>
        <div className='Cephalogram_box'>
          <div style={backgroundObj(imgsrc ? imgsrc : defaultImg)} className='Cephalogram_bg_box'></div>

        </div>
      </Col>
      <Col span={12} offset={6}>
        <Input onChange={(e) => {
          onChange({
            changeType: 'update',
            data: {
              ...data,
              label: e.target.value
            },
            index: index
          })
        }} value={label} placeholder='请输入标题'></Input>
      </Col>
      <Col span={12} offset={6}>
        <Input onChange={(e) => {
          onChange({
            changeType: 'update',
            data: {
              ...data,
              desc: e.target.value
            },
            index: index
          })
        }} value={desc} placeholder='请输入描述'></Input>
      </Col>
    </Row>

  );
};
export default Cephalogram;
